package com.game.springbootstart.mapper;

import com.game.springbootstart.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 游戏分类 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-01-16
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select id from game.category where name = #{category}")
    Long selectIdByName(String category);

    @Insert("INSERT INTO game.category (name, status) " +
            "VALUES (#{name}, #{status})")
    void save(Category categoryObj);
}
